@model Adams.Admin.DataTransfer.Events.Calendars.PageLoad
@{
    Layout = "~/Views/Events/_Layout.cshtml";
}
@section Head{

}
@if (!string.IsNullOrEmpty(ViewBag.Message))
{
    <div class="notification success png_bg">
        <a href="#" class="close">
            <img src="@Url.Content("/Content/images/cross_grey_small.png")" title="Close this notification"
            alt="close" /></a>
        <div>
            @if (ViewBag.Message == "1")
            {
                <b>Successfully saved Calendar!</b>
            }
            else if (ViewBag.Message == "2")
            {
                <b>Successfully deleted Calendar!</b>
            }
        </div>
    </div>
}
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>
            Current Calendars</h3>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        <table>
            <thead>
                <tr>
                    <th>
                        Name
                    </th>
                    <th>
                        Color
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var calendar in Model.Calendars)
                {
                    <tr>
                        <td>
                            @calendar.Name
                        </td>
                        <td>
                            @calendar.Color
                        </td>
                        <td>
                            <a href="@Url.Action("CreateCalendar", "Events", new { id = calendar.ID })" title="Edit">
                                <img src="@Url.Content("/Content/images/pencil.png")" alt="Edit" /></a> <a href="javascript:if(confirm('are you sure?')){location.href='@Url.Action("DeleteCalendar", "Events", new { id = calendar.ID })'}">
                                    <img src="@Url.Content("/Content/images/cross.png")" alt="Delete" /></a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <!-- End .content-box-content -->
</div>
<!-- End .content-box -->
@section Scripts {
    <script type="text/javascript" src="@Url.Content("/Scripts/Events/calendars.js")"></script>
}
